package com.it.hanzhongtravelv1.repository;

import com.it.hanzhongtravelv1.entity.FAQ;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface FAQRepository extends JpaRepository<FAQ, Long> {
    List<FAQ> findByCategory(String category);
    List<FAQ> findAllByOrderBySortOrderAsc();
    List<FAQ> findTop10ByOrderBySortOrderAsc();
    
    // 新增方法
    List<FAQ> findAllByOrderByCategoryAscSortOrderAsc();
    List<FAQ> findByCategoryOrderBySortOrderAsc(String category);
    List<FAQ> findByQuestionContainingOrAnswerContainingOrderBySortOrderAsc(String question, String answer);
} 